/*
 * @(#)Util.java
 *
 */

package diablo3.support;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Set;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * description
 * @author  huangyixiang
 * @version 2012-9-3
 */
public class Util {
	private static final Log LOG = LogFactory.getLog(Util.class);
	
	public static boolean isBlank (String str){
		return str == null || str.trim().equals("");
	}
	
	public static String formatDate2String(Date date){
		SimpleDateFormat dateformat2=new SimpleDateFormat("yyyy年MM月dd日 HH时mm分");   
        String a2=dateformat2.format(date);
        return a2;
	}
	
	public static void threadSleep(int seconds){
		try {
			Thread.sleep(seconds * 1000);
		} catch (InterruptedException e) {
			LOG.error(e.getMessage());
		}
	}
	
	public static void main(String[] args){
		// 创建一个扫描处理器，排除内部类 扫描符合条件的类
        ClassPathScanHandler handler = new ClassPathScanHandler(true, true,
                null);

        Set<Class<?>> calssList = handler.getPackageAllClasses(
                "diablo3.socket", true);
        System.out.println(calssList.iterator().next().getSimpleName());
	}
}
